package com.hurys.demo;

import com.hurys.demo.util.RedisUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@SpringBootApplication
@RestController
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @Resource(name = "redisDevTemplate")
    private RedisTemplate<String, Object> redisDevTemplate;

    @Resource(name = "redisUatTemplate")
    private RedisTemplate<String, Object> redisUatTemplate;

    @GetMapping("/test")
    public void test() {
        new RedisUtil(redisDevTemplate).set("testKey", "1");

        new RedisUtil(redisUatTemplate).set("testKey", "2");
    }

}
